﻿@model Pescar2013ShopYourAppliances.Models.Producto

@{
   ViewBag.Title = "Create";
}

<h2>Crear producto</h2>

@using (Html.BeginForm())
{
   @Html.ValidationSummary(true)

   <fieldset>
       <legend>Producto</legend>

       <div class="editor-label">
           @Html.LabelFor(model => model.nombre)
       </div>
       <div class="editor-field">
           @Html.EditorFor(model => model.nombre)
           @Html.ValidationMessageFor(model => model.nombre)
       </div>

       <div class="editor-label">
           @Html.LabelFor(model => model.modelo)
       </div>
       <div class="editor-field">
           @Html.TextAreaFor(model => model.modelo)
           @Html.ValidationMessageFor(model => model.modelo)
       </div>

       <div class="editor-label">
           @Html.LabelFor(model => model.marca)
       </div>
       <div class="editor-field">
           <select id="marca_id" name="marca_id">
               @using (var db = new Pescar2013ShopYourAppliances.Models.ContexDatos())
               {
                   foreach (var prd in db.marcas)
                   {
                   <option value="@prd.id">@prd.nombre</option>
                   }
               }
           </select>
       </div>
       <div class="editor-label">
           @Html.LabelFor(model => model.precio)
       </div>
       <div class="editor-field">
           @Html.TextAreaFor(model => model.precio)
           @Html.ValidationMessageFor(model => model.precio)
       </div>
       <div class="editor-label">
           @Html.LabelFor(model => model.url)
       </div>
       <div class="editor-field">
           @Html.EditorFor(model => model.url)
           @Html.ValidationMessageFor(model => model.url)
       </div>

       <div class="editor-label">
           @Html.LabelFor(model => model.descripcion)
       </div>
       <div class="editor-field">
           @Html.EditorFor(model => model.descripcion)
           @Html.ValidationMessageFor(model => model.descripcion)
       </div>

       <p>
           <input type="submit" value="Crear" />
       </p>
   </fieldset>
}

<div>
   @Html.ActionLink("Volver a la lista wachim", "Index")
</div>

@section Scripts {
   @Scripts.Render("~/bundles/jqueryval")
}